package returnDataStruct;

import pojo.room;

import java.util.Calendar;
import java.util.Date;

public class roomDate {
    private int year;
    private int month;
    private int day;
    private int starttime;
    private int endtime;

    public roomDate(room r){
        Calendar calendar= Calendar.getInstance();
        Date d=r.getDate();
        calendar.setTime(d);
        setYear(calendar.get(Calendar.YEAR));
        setMonth(calendar.get(Calendar.MONTH)+1);
        setDay(calendar.get(Calendar.DAY_OF_MONTH));
        setStarttime(r.getStart_time());
        setEndtime(r.getEnd_time());
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public int getStarttime() {
        return starttime;
    }

    public void setStarttime(int starttime) {
        this.starttime = starttime;
    }

    public int getEndtime() {
        return endtime;
    }

    public void setEndtime(int endtime) {
        this.endtime = endtime;
    }

    @Override
    public String toString() {
        return "roomDate{" +
                "year=" + year +
                ", month=" + month +
                ", day=" + day +
                ", starttime=" + starttime +
                ", endtime=" + endtime +
                '}';
    }
}
